using System.ComponentModel.DataAnnotations;

namespace OutpatientApi.DTO
{
    /// <summary>
    /// 添加患者住院登记DTO
    /// </summary>
    public class AddPatientAdmissionDto
    {
        /// <summary>
        /// 患者卡号，标识患者
        /// </summary>
        [Required(ErrorMessage = "患者卡号不能为空")]
        [StringLength(20, ErrorMessage = "患者卡号长度不能超过20个字符")]
        public string Patient { get; set; } = string.Empty;

        /// <summary>
        /// 关联科室表的外键,标识患者所属科室
        /// </summary>
        [Required(ErrorMessage = "科室ID不能为空")]
        public int DepartmentId { get; set; }

        /// <summary>
        /// 关联病房表的外键,标识患者入住的病房
        /// </summary>
        [Required(ErrorMessage = "病房ID不能为空")]
        public int RoomId { get; set; }

        /// <summary>
        /// 关联病床表的外键,标识患者入住的具体病床
        /// </summary>
        [Required(ErrorMessage = "病床ID不能为空")]
        public int HospitalId { get; set; }

        /// <summary>
        /// 患者预交的费用金额(单位:元)
        /// </summary>
        [Required(ErrorMessage = "预交费不能为空")]
        [Range(0.01, 999999.99, ErrorMessage = "预交费必须在0.01-999999.99之间")]
        public decimal Prepayment { get; set; }

        /// <summary>
        /// 患者的病情详细描述
        /// </summary>
        [StringLength(2000, ErrorMessage = "病情描述长度不能超过2000个字符")]
        public string ConditionDesc { get; set; } = string.Empty;

        /// <summary>
        /// 患者对某些药物的禁忌情况
        /// </summary>
        [StringLength(1000, ErrorMessage = "药物禁忌描述长度不能超过1000个字符")]
        public string DrugContraindications { get; set; } = string.Empty;
    }

    /// <summary>
    /// 患者住院登记返回DTO（包含关联表信息）
    /// </summary>
    public class PatientAdmissionDto
    {
        /// <summary>
        /// 住院登记ID
        /// </summary>
        public int AdmissionId { get; set; }

        /// <summary>
        /// 患者卡号
        /// </summary>
        public string Patient { get; set; } = string.Empty;

        /// <summary>
        /// 科室ID
        /// </summary>
        public int DepartmentId { get; set; }

        /// <summary>
        /// 科室名称
        /// </summary>
        public string DepartmentName { get; set; } = string.Empty;

        /// <summary>
        /// 病房ID
        /// </summary>
        public int RoomId { get; set; }

        /// <summary>
        /// 病房号
        /// </summary>
        public string RoomNumber { get; set; } = string.Empty;

        /// <summary>
        /// 病床ID
        /// </summary>
        public int HospitalId { get; set; }

        /// <summary>
        /// 病床号
        /// </summary>
        public string HospitalName { get; set; } = string.Empty;

        /// <summary>
        /// 预交费
        /// </summary>
        public decimal Prepayment { get; set; }

        /// <summary>
        /// 病情描述
        /// </summary>
        public string ConditionDesc { get; set; } = string.Empty;

        /// <summary>
        /// 药物禁忌
        /// </summary>
        public string DrugContraindications { get; set; } = string.Empty;

        /// <summary>
        /// 入院时间
        /// </summary>
        public DateTime AdmissionTime { get; set; }
    }
} 